<script src="<?php echo base_url() ?>commons/validacion/js/jquery-1.8.2.min.js" type="text/javascript"></script>
<link href="<?php echo base_url() ?>commons/validacion/css/validationEngine.jquery.css" rel="stylesheet">
<script src="<?php echo base_url() ?>commons/validacion/js/languages/jquery.validationEngine-es.js" type="text/javascript" charset="utf-8"></script>
<script src="<?php echo base_url() ?>commons/validacion/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>



<script>
    var t = jQuery.noConflict();
    t(document).ready(function() {
        // binds form submission and fields to the validation engine			
        t("#formID").validationEngine();
        t("#formID1").validationEngine();
        t("#formID2").validationEngine();
    });

    /**
     *
     * @param {jqObject} the field where the validation applies
     * @param {Array[String]} validation rules for this field
     * @param {int} rule index
     * @param {Map} form options
     * @return an error string if validation failed
     */
    function checkHELLO(field, rules, i, options) {
        if (field.val() != "HELLO") {
            // this allows to use i18 for the error msgs
            return options.allrules.validate2fields.alertText;
        }
    }
</script>
<link rel="stylesheet" href="<? echo base_url() ?>commons/jquery/themes/base/jquery.ui.all.css">

<script src="<?php echo base_url() ?>commons/jquery/ui/jquery.ui.core.js"></script>
<script src="<?php echo base_url() ?>commons/jquery/ui/jquery.ui.widget.js"></script>
<script src="<?php echo base_url() ?>commons/jquery/ui/jquery.ui.tabs.js"></script>

<!--
<script src="<?php echo base_url() ?>commons/jquery/external/jquery.mousewheel.js"></script>
<script src="<?php echo base_url() ?>commons/jquery/external/globalize.js"></script>
<script src="<?php echo base_url() ?>commons/jquery/external/globalize.culture.de-DE.js"></script>
<script src="<?php echo base_url() ?>commons/jquery/external/globalize.culture.ja-JP.js"></script>
<script src="<?php echo base_url() ?>commons/jquery/ui/jquery.ui.core.js"></script>
<script src="<?php echo base_url() ?>commons/jquery/ui/jquery.ui.widget.js"></script>
<script src="<?php echo base_url() ?>commons/jquery/ui/jquery.ui.button.js"></script>
<script src="<?php echo base_url() ?>commons/jquery/ui/jquery.ui.spinner.js"></script>
<link rel="stylesheet" href="<? echo base_url() ?>commons/jquery/demos/demos.css">
<link rel="stylesheet" href="<? echo base_url() ?>commons/jquery/themes/base/jquery.ui.all.css">
<script>
    var t1 = jQuery.noConflict();
        t1(function() {
                        
                t1( "#1_ec1" ).spinner({
                        step: 0.01,
                        numberFormat: "n"
                });

                
        });
        </script>
-->
<script>
    var t1 = jQuery.noConflict();
    t1(function() {
        //t1("#tabs").tabs().addClass("ui-tabs-vertical ui-helper-clearfix");
        //t1("#tabs li").removeClass("ui-corner-top").addClass("ui-corner-left");
        t1("#tabs").tabs();
    });
</script>
<style>
    #tabs{
        
        width: 100%;
        overflow: scroll;
    }
    .letra{
        font-size: 10px;
    }
    .ui-tabs-vertical { width: 25em; }
    .ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 12em; }
    .ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
    .ui-tabs-vertical .ui-tabs-nav li a { display:block; font-size: 10px;}
    .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; }
    .ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: right; width: 40em;}
</style>
</br>
<?php
/* echo '<div>';

  echo '<p style="text-align: center;font-weight: bold;"><span>PERIODO '.$periodo[0]["descripcion_lec"].'</span></p>';
  echo '<p><span><b>CARRERA:</b> '.$carrera.'</span></p>';
  echo '<p><span><b>CICLO:</b> '.$ciclo.'</span></p>';
  echo '<p><span><b>MATERÍA:</b> '.$materia.'</span></p>';
  echo '<p><span><b>PARALELO:</b> '.$paralelo.'</span></p>';
  echo '<p><span><b>SECCIÓN:</b> '.$seccion.'</span></p>';
  echo '</div>'; */
?>
<?php
$CI = & get_instance();
echo '<script type="text/javascript">';
echo 'var t = jQuery.noConflict(); ';
echo 't(document).ready(function(){
				       setTimeout(function(){ t(".mensajes").fadeOut(800).fadeIn(800).fadeOut(500).fadeIn(500).fadeOut(300);}, 3000); ';
echo '		});';
echo '</script>';
echo validation_errors('<div class="error">', '</div>');
if ($this->session->flashdata('error')) {
    echo "<div class='error mensajes'>";
    echo $this->session->flashdata('error');
    echo "</div>";
}
if ($this->session->flashdata('info')) {
    echo "<div class='info mensajes'>";
    echo $this->session->flashdata('info');
    echo "</div>";
}
//alerta
if ($this->session->flashdata('exito')) {
    echo "<div class='info mensajes'>";
    echo $this->session->flashdata('exito');
    echo "</div>";
}
if ($this->session->flashdata('alerta')) {
    echo "<div class='info mensajes'>";
    echo $this->session->flashdata('alerta');
    echo "</div>";
}
if (count($cursas) > 0) {
    // $aux = 'return confirm("Esta seguro de realizar esta operación");';
    //echo "<a href='" . base_url() . "docente.php/docente/volveCrearListaAlumno" . $link . "' class='btn' onclick='" . $aux . "'>VOLVER A GENERAR LISTADO</a>";
}
?>
</br>

</br>


<div id="tabs" >
    <ul>
        <?php
        $cont = 1;
        foreach ($cursas as $value) {
            echo '<li><a href="#tabs-' . $cont . '" class="letra">' . $value["descripcion_lec"] . '</a></li>';
            $cont++;
        }
        ?>


    </ul>
    <?php
    $cont = 1;
    foreach ($cursas as $value) {
        echo '<div id="tabs-' . $cont . '" >';
        $lista = $CI->utilidades->listaMaterias($value["periodos_lectivos_ide_lec"],$value["estudiante_ide_est"]);
        
        if (count($lista) > 0) {
            echo '<table class="table table-bordered table-striped tablaVista" >';
            echo '<thead><tr><th>Materia</th><th>Nota primer bimestre</th><th>Nota segundo bimestre</th><th>Total</th><th>Asistencia</th><th>Aprobado</th>';
            echo '</thead><tbody>';
            foreach ($lista as $item) {
                $suma = $item["total1"]+$item["total2"];
                $asiste = $item["asiste1_cal"]+$item["asiste2_cal"];
                echo '<tr>';
                echo '<td>'.$item["nombre_mat"].'</td>';
                echo '<td>'.$item["total1"].'</td>';
                echo '<td>'.$item["total2"].'</td>';
                echo '<td>'.$suma.'</td>';
                echo '<td>'.((($asiste/2)*100)/100).'%</td>';
                if($suma >=28&&$asiste>=149){
                    echo '<td>APROBADA</td>';
                }else{
                    echo '<td>REPROBADA</td>';
                }
                
                echo '</tr>';
            }
            echo '</tbody></table>';
        } else {
            echo '<span>No exitesn materias</span>';
        }
        echo '</div>';
        $cont++;
    }
    ?>

</div>
